                      ===================================
                      AdvanceCOMP MNG Compression Utility
                      ===================================


1 SYNOPSIS
==========

advmng [-l, --list] [-z, --recompress]
	[-x, --extract] [-a, --add RATE MNG_FILE PNG_FILES...]
	[-0, --shrink-store] [-1, --shrink-fast] [-2, --shrink-normal]
	[-3, --shrink-extra] [-4, --shrink-insane] [-i, --iter N]
	[-s, --scroll HxV] [-S, --scroll-square]
	[-e, --expand] [-r, --reduce]
	[-c, --lc] [-C, --vlc] [-f, --force] [-q, --quiet] [-v, --verbose]
	[-h, --help] [-V, --version] FILES...


2 DESCRIPTION
=============

The main purpose of this utility is to recompress MNG
files to get the smallest possible size.

Please note that this utility is not able to read
a generic file. It's granted to be able to read only
the files generated by the AdvanceMAME emulator.

To compress the files this utility uses the following
strategies:

* Remove all ancillary chunks.
* Use the MNG Delta feature to compress video clips with
  only small changes between frames.
* Use the MNG Move feature to compress video clips with
  a scrolling background (option -s).
* Reduce the color depth to 8 bit (option -r).
* Use the 7zip Deflate implementation.


3 COMMANDS
==========

    -l, --list FILES...
        List the content of the specified files.

    -z, --recompress FILES...
        Recompress the specified files. If the -1, -2, -3
        options are specified, it's used the smallest file
        choice from the previous compressed data and the
        new compression. If the -0 option is specified the
        file is always rewritten without any compression.

    -x, --extract FILES...
        Extract all the .png frames in the .mng clips.
        You can use the --shrink options to control the
        compression ratio of the .png files. The extracted
        images are always 24 bit images with alpha channel.
        You can remove the alpha channel with the -n option.

    -a, --add RATE MNG_FILE PNG_FILES...
        Compress all the .png files on the command line
        as a .mng file. All the .png files must have the
        same size and the same bit depth. You must also
        specify an integer frame rate to use in the
        .mng file.


4 OPTIONS
=========

    -0, --shrink-store
        Disable the compression. The file is
        only stored and not compressed. The file is always
        rewritten also if it's bigger.

    -1, --shrink-fast
        Set the compression level to "fast" using the zlib
        compressor.

    -2, --shrink-normal
        Set the compression level to "normal" using the libdeflate
        compressor.
        This is the default level of compression.

    -3, --shrink-extra
        Set the compression level to "extra" using the 7z
        compressor.
        You can define the compressor iterations with
        the -i, --iter option.

    -4, --shrink-insane
        Set the compression level to "insane" using the zopfli
        compressor.
        You can define the compressor iterations with
        the -i, --iter option.

    -i, --iter N
        Define an additional numer of iterations for the 7z and zopfli
        compressors for modes -3 and -4.
        More iterations usually give a better compression, but may
        require a lot more time.
        Try for example with 10, 15, 20, and so on.

    -s, --scroll HxV
        The "-s HxV" option specifies the size of the pattern
        (H width x V height) used to check for a
        scrolling background. The size is expressed in
        pixels and it must be bigger or equal than the
        scrolling speed of the background. For example
        take the game 1942 that scrolls vertically by 1
        pixel every frame. If you recorded with an interleave
        factor of 2 the vertical scrolling speed is
        1*2 = 2. In this case the minimum pattern is "-s 0x2".
        Generally you can use "-s 8x8" and use bigger
        values only for games scrolling faster. If the
        game scrolls only horizontally or vertically you can
        speed up a lot the compression with monodirectional
        patterns like "-s 16x0" or "-s 0x16".

    -S, --scroll-square N
        This option is like the option "-s NxN" but excludes
        big movement on both directions reducing the computation
        time. Specifically the check done is X+Y<=N.

    -r, --reduce
        Force the color reduction to 8 bit. The reduction is
        really done only if any frame have less than 256 colors
        and if no alpha channel is present. To force the reduction
        also if an alpha channel is present use the -n option.

    -e, --expand
        Force the color expansion to 24 bit.

    -n, --noalpha
        Remove the alpha channel if present.

    -c, --lc
        Force the use of the MNG LC (Low Complexity)
        specifications. It disables the delta compression.
        The file is always rewritten also if it's bigger.

    -C, --vlc
        Force the use of the MNG VLC (Very Low Complexity)
        specifications. It disables the delta compression
        and the precise timing. Warning! you may lose the
        correct timing information because the VLC format
        only supports integer frequency. The file is always
        rewritten also if it's bigger.

    -f, --force
        Force the use of the new file also if it's bigger.

    -q, --quiet
        Don't print the filenames.

    -v, --verbose
        Print more information on the compression process.


5 EXAMPLES
==========

A good tradeoff of recompression and time is the command :

    advmng -z -r -S 16 *.mng

To create a .mng file from a series of .png files use the
command :

    advmng -a 30 video.mng video*.png

To extract all the images in a .mng file use the command :

    advmng -x video.mng


6 COPYRIGHT
===========

This file is Copyright (C) 2003 Andrea Mazzoleni, Filipe Estima


7 SEE ALSO
==========

advzip(1), advpng(1), advdef(1)
                            =======================
                            History For AdvanceCOMP
                            =======================


ADVANCECOMP VERSION 2.1 2018/02
===============================

* Support ZIPs with data descriptor signature.
* Fixed a crash condition with invalid ZIP data.


ADVANCECOMP VERSION 2.0 2017/06
===============================

* Added support for reading MNG files with depth of 1, 2, and 4 bits.
* Added 64 bits binary for Windows.
* Updated to libdeflate 29-May-2017.
  From https://github.com/ebiggers/libdeflate
  at commit 1726e9e87fb6f98682dfdea2356d5ee58881fe7b.


ADVANCECOMP VERSION 1.23 2016/11
================================

* Fixed build issue from source code due missing libdeflate header.


ADVANCECOMP VERSION 1.22 2016/11
================================

* Enabled again the command line wildcard expansion in the Windows
  builds. The new MingW compiler was disabling it by default.


ADVANCECOMP VERSION 1.21 2016/11
================================

* Added libdeflate support. It's the new default because it provides
  better performance and compression than 7z.
  From https://github.com/ebiggers/libdeflate
  at commit 28cc14994b8b57f590d31a7340c8fffc5cc37d88.
* Update to the latest zopfli library.
  From https://github.com/google/zopfli
  at commit 6818a0859063b946094fb6f94732836404a0d89a.
* Windows binaries built with MingW 4.9.3 using the MXE cross compiler at
  commit 62bcdbee56e87c81f1faa105b8777a5879d4e2e with targets
  i686-w64-mingw32 and x86_64-w64-mingw32.
* DOS binaries built with DJGPP 4.8.5 from
  https://github.com/andrewwutw/build-djgpp


ADVANCECOMP VERSION 1.20 2015/08
================================

* Fixed .gz recompression of data bigger than 400 MB.
* Fixed .gz recompression with -0 and -1 options.
* Updated to the latest zopfli [Aaron Kaluszka].
* Preserve the EFS flag in .zip files [Jason Penney].


ADVANCECOMP VERSION 1.19 2014/03
================================

* Limited the iterations number to 255 with the -3 option.
* Added a new -k, --keep-file-time option to advzip [Marco Banfi].
* Made the Windows binary again compatible with old 686 processors.


ADVANCECOMP VERSION 1.18 2013/11
================================

* Added build support for new powerpc architectures.
* Fixed build with BZIP.


ADVANCECOMP VERSION 1.17 2013/03
================================

* Changed to GPL3.
* Added zopfli support. It's enabled using -4, --shrink-insane.
  You can control the number of iterations with the
  new -i, --iter option.
  Thanks to Darik Horn for the patches.


ADVANCECOMP VERSION 1.16 2013/03
================================

* Allowed recompression with files with zero length.
* Some other minor bugfixes.
* Now in git repository.


ADVANCECOMP VERSION 1.15 2005/10
================================

* Fixed the date displayed with the -l advzip command.
* The advdef utility now detects the file type from the file
  header instead of using the extension.
* Fixed a lot of bugs in the 64 bits platforms.


ADVANCECOMP VERSION 1.14 2005/02
================================

* Relaxed a consistency check for the local header in zip files.
  The crc and size entries are allowed to contain the real
  value also if a data descriptor is present.
* Fixed the conversion of RGB images with less than 256 color
  with transparency data.
* Minor fixes at the documentation.


ADVANCECOMP VERSION 1.13 2004/11
================================

* Added support for .svgz files at advdef [rener].
* Fixed the 8 bit color reduction of 32 bit png files.


ADVANCECOMP VERSION 1.12 2004/09
================================

* Fixed a compilation problem with gcc 3.4.


ADVANCECOMP VERSION 1.11 2004/07
================================

* Fixed a FreeBSD libc compatibility issue recompressing
  .gz files [Radim Kolar].
* Fixed a segmentation fault when some invalid
  compressed .zip files are tested.


ADVANCECOMP VERSION 1.10 2004/04
================================

* Added support for alpha channel and the new -n option
  at advmng.
* Fixed the uncompressing error "Invalid compressed data in ..."
  with some GZIP files [Christian Lestrade].


ADVANCECOMP VERSION 1.9 2003/11
===============================

* Added support for .tgz files at advdef.
* Added the -a option at advmng to create .mng files from
  a sequence of .png files.


ADVANCECOMP VERSION 1.8 2003/10
===============================

* Added support for .gz files at advdef.
* Fixed support for .png files with splitted IDATs.


ADVANCECOMP VERSION 1.7 2003/08
===============================

* Fixed a Segmentation Fault bug on the advmng -r option on
  the latest gcc.
* Better and faster (MMX) move recognition in the advmng scroll
  compression.
* The frame reduction of the advmng utility is now done only if possible.
  The compression process never fails.
* Added a new -S (--scroll-square) option at advmng.
* Added a new -v (--verbose) option at advmng to show the
  compression status.
* Changed the internal ID for the bzip2 and LZMA compression.
  The bzip2 ID is now compatible with the PKWARE specification.
* Added support for RGB images with alpha channel at the advpng utility.
* Updated with automake 1.7.6.


ADVANCECOMP VERSION 1.6 2003/05
===============================

* Added the `-x' option at the advmng utility to export .png files
  from a .mng clip. Useful to compress it in an MPEG file.
* Fixed the support for zips with additional data descriptors.
* Updated with autoconf 2.57 and automake 1.7.4.
* Some fixes for the gcc 3.3 compiler.


ADVANCECOMP VERSION 1.5 2003/01
===============================

* Splitted from AdvanceSCAN
* Added the `advdef' compression utility.


ADVANCESCAN VERSION 1.4 2002/12
===============================

* Fixed a bug in the advmng utility when it was called with
  more than one file in the command line. The program
  was incorrectly adding a PLTE chunk at rgb images.


ADVANCESCAN VERSION 1.3 2002/11
===============================

* Added the support for the transparency tRNS chunk at the
  advpng utility.
* Upgraded at the latest Advance Library.
* Fixes at the docs. [Filipe Estima]
* Minor changes at the autoconf/automake scripts.


ADVANCESCAN VERSION 1.2 2002/08
===============================

* Added the advpng utility to compress the PNG files.
* Added the advmng utility to compress the MNG files.
* Added a Windows version.
* Other minor fixes.


ADVANCESCAN VERSION 1.1 2002/06
===============================

* Fixed an infinite loop bug testing some small damaged zips.
* Removed some warning compiling with gcc 3.1.


ADVANCESCAN VERSION 1.0 2002/05
===============================

* First public release.
* Fixed the compression percentage computation on big files.
* Added the --pedantic option at the advzip utility. These
  tests are only done if requested.


ADVANCESCAN VERSION 0.6-BETA 2002/05
====================================

* Added the AdvanceZIP utility.
                              ===================
                              AdvanceCOMP Authors
                              ===================


AUTHORS
=======

The author of AdvanceCOMP and releated utilities is
Andrea Mazzoleni.

You can contact me sending an email at:

    amadvance@gmail.com


ACKNOWLEDGMENTS
===============

A lot of other people helped submitting patches, bug reports
and generic comments. A special mention to:

* Filipe Estima
                       =================================
                       AdvanceCOMP Compression Utilities
                       =================================

AdvanceCOMP contains recompression utilities for your .zip archives,
.png images, .mng video clips and .gz files.

It runs in Linux, Mac OS X, DOS, Windows and in all the other
Unix like platforms.

The official site of AdvanceCOMP is:

    http://www.advancemame.it

This package contains:
    advzip - Recompression and test utility for zip files
    advpng - Recompression utility for png files
    advmng - Recompression utility for mng files
    advdef - Recompression utility for deflate streams in .png, .mng and .gz files
